package com.wynne.ptldemo.repository;


import com.wynne.ptldemo.pojo.PtlAreaSectionTaskDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public interface PtlAreaSectionTaskDetailRepository extends JpaRepository<PtlAreaSectionTaskDetail, Long> {

    List<PtlAreaSectionTaskDetail> findAll();

    @Modifying
    @Transactional
    @Query("update PtlAreaSectionTaskDetail  astd set astd.status=0")
    void updateAllStatus();
}
